﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;

namespace fazendo_jogo
{
    public abstract class Objeto_de_Jogo
    {
        public Vector2 Posicao { get; set;}
        public Texture2D Textura{ get; set;}
        public Rectangle Retangulo{ get; set;}

        public Objeto_de_Jogo(Vector2 posicao, Texture2D textura)
        {
            this.Posicao = posicao;
            this.Textura = textura;
            this.Retangulo = new Rectangle ((int)this.Posicao.X, (int)(this.Posicao.Y), this.Retangulo.Width, this.Retangulo.Height);
        }
        public virtual void Update(Rectangle clientBounds)
        {
            this.Retangulo = new Rectangle((int)this.Posicao.X, (int)(this.Posicao.Y), this.Retangulo.Width, this.Retangulo.Height);
        }
        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(this.Textura, this.Retangulo, Color.White);
        }
        public bool Collision(Objeto_de_Jogo objeto_do_jogo)
        {
            return this.Retangulo.Intersects(objeto_do_jogo.Retangulo);
        }
    }
}
